#ifndef __MCPARALLELCONSTRAINT_H_
#define __MCPARALLELCONSTRAINT_H_

#include <MCConstraint.h>
#include <MCSegmentVisual.h>
#include <cg_api.h>
#include <cg_geometric_api.h>

class MCParallelConstraintVisual;

class MCParallelConstraint : public MCConstraint
{
public:

    MCParallelConstraint(MCSegmentVisual *s1, MCSegmentVisual *s2);
    ~MCParallelConstraint();

    void resolve() override;

public:

    MCSegmentVisual *_segment1;
    MCSegmentVisual *_segment2;

private:

    void makeCollinier(MCVector2 &dir1, MCVector2 &dir2);

private:
    
    MCParallelConstraintVisual *_visual;

    MCVector2 _rootDir1;
    MCVector2 _rootDir2;

    cg::Solver _solver;
    

};

#endif // !__MCPARALLELCONSTRAINT_H_
